<?php
include('../confing/common.php');

$redis=new Redis();
$redis->connect("127.0.0.1","6379");
//$redis->flushAll();//清空队列
echo "连通redis： " . $redis->ping() . "\r\n";
$lenth=$redis->LLEN('oids');
//$a=$DB->query("select * from pre_order where dockstatus=1 and status='进行中' order by oid desc limit 10");
//$a=$DB->query("select * from pre_order where dockstatus=1 and status='进行中'");
$i=0;
// $a=$DB->query("select * from qingka_wangke_order where status='进行中' or status='补刷中' or status='待处理' order by oid asc");
if ($lenth==0){
    $a=$DB->query("select * from qingka_wangke_order where status!='已完成' order by oid asc");
    foreach($a as $b){    
        $redis->lPush("oids",$b['oid']);
        $i++;
    }
    echo "入队成功！本次入队订单共计：".$i."条！\r\n";
}else{
    echo("入队失败！队列池还有：".$redis->LLEN('oids')."条订单正在执行\r\n");
}


?>